import httpUtils from "@/core/utils/http.utils";
// service path
const urls = {
    'getFilePage': `/api/upms/ossFile/page`,
    'deleteFileById': `/api/upms/ossFile/`,
    'uploadFile': `/api/upms/ossFile/upload`,
    'downloadFile': `/api/upms/ossFile/`,
};
// service methods
const fileApi = {
    getFilePage (param) {
        return httpUtils.get(urls.getFilePage, param);
    },
    deleteFile(id) {
        return httpUtils.delete(urls.deleteFileById + id);
    },
    uploadFile(param) {
        return httpUtils.postRequest(urls.uploadFile, param);
    },
    downloFile(file) {
        return httpUtils.downloadUrlMode(urls.downloadFile+file.bucketName+"/"+file.fileName, "get",file.fileName,null,file.fileType);
    },

};

export default fileApi;
